﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ServiceCore.Tool.JD_Pay
{
    #region 统一下单   
    public class Ex_params
    {
        /// <summary>
        /// 唯一识别编号
        /// </summary>
        public string openid { get; set; }
        /// <summary>
        /// IP地址
        /// </summary>
        public string IP { get; set; }
        /// <summary>
        /// 支付类型
        /// </summary>
        public string piType { get; set; }
        /// <summary>
        /// 入驻过的商户ID
        /// </summary>
        public string baseuserid { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string remark { get; set; }
        /// <summary>
        /// 原路返回的参数
        /// </summary>
        public string returnParams { get; set; }
        /// <summary>
        /// 调起支付的方法
        /// </summary>
        public string PayMethod { get; set; } = "SUBSCRIPTION";
    }
    /// <summary>
    /// 统一下单入参方法
    /// </summary>
    public class unifiedOrder_Parms : JD_Api_Base_Params
    {
        public unifiedOrder_Parms()
        {
            this.Request_URL = CodeContent.Api_Url.unifiedOrder;
        }
        /// <summary>
        /// 交易备注 否
        /// </summary>
        public string remark { get; set; }
        /// <summary>
        /// 交易截止时间 否 格式：yyyyMMddHHmmss，默认：交易时间+7天
        /// </summary>
        public string deadlineTime { get; set; }
        /// <summary>
        /// 交易时间 否 格式：yyyyMMddHHmmss，默认为当前时间
        /// </summary>
        public string tradeTime { get; set; }
        /// <summary>
        /// 交易金额 是 单位：分，交易金额
        /// </summary>
        public long amount { get; set; }
        /// <summary>
        /// 原样回传参数 否 
        /// </summary>
        public string returnParams { get; set; }
        /// <summary>
        /// 商品信息 否 
        /// </summary>
        public string goodsInfoList { get; set; }
        /// <summary>
        /// 订单信息 否 
        /// </summary>
        public string orderInfo { get; set; } 
        /// <summary>
        /// 商户用户id 否
        /// </summary>
        public string userId { get; set; }
        /// <summary>
        /// 备用扩展字段 否
        /// </summary>
        public string extMap { get; set; }
        /// <summary>
        /// 外部订单号 是
        /// </summary>
        public string outTradeNo { get; set; }
        /// <summary>
        /// 客户端传入IP 是
        /// </summary>
        public string outTradeIp { get; set; }
        /// <summary>
        /// 商品简称 是  聚合付款码业务必填
        /// </summary>
        public string productName { get; set; }
        /// <summary>
        /// openId 否  注意：微信、支付宝、云闪付必传（通过6.4.7获取openId），京东支付该值不传
        /// </summary>
        public string openId { get; set; }
        /// <summary>
        /// 币种 是  
        /// </summary>
        public string currency { get; set; } = "RMB"; 
        /// <summary>
        /// 支付成功异步通知地址 是  
        /// </summary>
        public string notifyUrl { get; set; }
        /// <summary>
        /// 支付产品 是 
        /// </summary>
        public string piType { get; set; }
        /// <summary>
        /// 接入方式 是  MINIPROGRAM：小程序   SUBSCRIPTION：公众号，服务号，京东支付、云闪付支付 
        /// </summary>
        public string gatewayPayMethod { get; set; }
        /// <summary>
        /// 终端信息 是
        /// </summary>
        public string deviceInfo { get; set; }
        /// <summary>
        /// 门店号 否
        /// </summary>
        public string shopId { get; set; }
        /// <summary>
        /// 商户门店号 否
        /// </summary>
        public string outShopId { get; set; }
        /// <summary>
        /// 分账信息 否
        /// </summary>
        public string billSplitList { get; set; }
    }
    /// <summary>
    /// 下单时可选提交的商品信息
    /// </summary>
    public class goodsInfo
    {
        /// <summary>
        /// 商品编号 是
        /// </summary>
        public string id { get; set; }
        /// <summary>
        /// 商品名称 是
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 商品单价
        /// </summary>
        public long price { get; set; }
        /// <summary>
        /// 商品数量
        /// </summary>
        public int num { get; set; }

        ///// <summary>
        ///// 微信/支付宝侧商品编码
        ///// </summary>
        //public string chId { get; set; }
        ////商品三级类目 

        //public string cat1 { get; set; }
        //public string cat2 { get; set; }
        //public string cat3 { get; set; }
        ///// <summary>
        ///// 商品类型
        ///// </summary>
        //public string type { get; set; }
        ///// <summary>
        ///// 门店ID
        ///// </summary>
        //public string storeId { get; set; }
        ///// <summary>
        ///// 商品信息描述
        ///// </summary>
        //public string desc { get; set; }
        ///// <summary>
        ///// 商品展示地址
        ///// </summary>
        //public string showUrl { get; set; }
        ///// <summary>
        ///// 商品条码
        ///// </summary>
        //public string barcode { get; set; }
        ///// <summary>
        ///// 商品图片地址
        ///// </summary>
        //public string imageUrl { get; set; }
        ///// <summary>
        ///// 单位
        ///// </summary>
        //public string unit { get; set; }
        ///// <summary>
        ///// 保质期
        ///// </summary>
        //public int expirationPeriod { get; set; }
        ///// <summary>
        ///// 保质期单位  (year,month,day,hour,minute,second,默认day)
        ///// </summary>
        //public string expirationPeriodUnit { get; set; }
        ///// <summary>
        ///// 商品产地
        ///// </summary>
        //public string originPlace { get; set; }
        ///// <summary>
        ///// 颜色
        ///// </summary>
        //public string color { get; set; }
        ///// <summary>
        ///// 尺码
        ///// </summary>
        //public string size { get; set; }
        ///// <summary>
        ///// 销售属性 json数组格式：  [{“key”:”属性名称”,”value”,”属性值”},{“key”:”属性名称”,”value”,”属性值”}] 
        ///// </summary>
        //public string features { get; set; }
    }
    /// <summary>
    /// 终端信息
    /// </summary>
    public class deviceInfo
    {
        /// <summary>
        /// 类型
        /// </summary>
        public string type { get; set; }
        /// <summary>
        /// IP
        /// </summary>
        public string ip { get; set; }
        ///// <summary>
        ///// mac 否
        ///// </summary>
        //public string mac { get; set; }
        /// <summary>
        /// imei  设备号 
        /// </summary>
        public string imei { get; set; }
        ///// <summary>
        ///// 终端 idfv
        ///// </summary>
        //public string idfv { get; set; }
        ///// <summary>
        ///// 终端 adid
        ///// </summary>
        //public string adid { get; set; }
        ///// <summary>
        ///// 终端 posid
        ///// </summary>
        //public string posid { get; set; }
    }
    /// <summary>
    /// 分账列表
    /// </summary>
    public class billSplitList
    {
        /// <summary>
        /// 分账金额 分账金额单位:元,最多保留两位小数
        /// </summary>
        public string splitBillAmount { get; set; }
        /// <summary>
        /// 分账商户的邮箱 不可以重复出现同一邮箱，不可以传分账发起方自己
        /// </summary>
        public string splitBillMerchantEmail { get; set; }
    }
    /// <summary>
    /// 5.6	orderInfo订单信息
    /// </summary>
    public class orderInfo
    {
        /// <summary>
        /// 支付订单
        /// </summary>
        public string title { get; set; }
        /// <summary>
        /// 订单描述
        /// </summary>
        public string des { get; set; }
        /// <summary>
        /// 可优惠金额 当前订单可以参与优惠计算的金额 (单位:分)，必须小于订单原价
        /// </summary>
        public long dctAmount { get; set; }
        /// <summary>
        /// 订单原价
        /// </summary>
        public long amount { get; set; }
        /// <summary>
        /// 商品小票ID
        /// </summary>
        public string receiptId { get; set; }
        /// <summary>
        /// 附加信息 内容自定义
        /// </summary>
        public string addnInfo { get; set; }
    }
    /// <summary>
    /// 统一下单返回数据
    /// </summary>
    public class unifiedOrder_Result
    {
        /// <summary>
        /// 调用状态 SUCCESS：接口调用成功  FAIL：接口调用失败  
        /// </summary>
        public string resultCode { get; set; }
        /// <summary>
        /// 业务错误代码
        /// </summary>
        public string errCode { get; set; }
        /// <summary>
        /// 业务错误代码描述
        /// </summary>
        public string errCodeDes { get; set; }
        public string businessCode { get; set; }
        /// <summary>
        ///  商户号
        /// </summary>
        public string merchantNo { get; set; }
        /// <summary>
        /// 外部订单号
        /// </summary>
        public string outTradeNo { get; set; }
        /// <summary>
        /// 聚合订单号
        /// </summary>
        public string tradeNo { get; set; }
        /// <summary>
        /// 版本号
        /// </summary>
        public string version { get; set; }
        /// <summary>
        /// 支付方式
        /// </summary>
        public string piType { get; set; }
        /// <summary>
        /// 币种
        /// </summary>
        public string currency { get; set; }
        /// <summary>
        /// 交易金额
        /// </summary>
        public string amount { get; set; }
        /// <summary>
        ///  交易时间
        /// </summary>
        public string tradeTime { get; set; }
        /// <summary>
        ///  回传参数
        /// </summary>
        public string returnParams { get; set; }
        /// <summary>
        /// 扩展信息 聚合支付返回扩展信息（map转json数据）
        /// </summary>
        public string extMapStr { get; set; }
        /// <summary>
        /// 小程序ID
        /// </summary>
        public string appId { get; set; }

        public string payInfo { get; set; }
        /// <summary>
        /// 交易截止日期
        /// </summary>
        public string deadlineTime { get; set; }
        /// <summary>
        /// 系统名称
        /// </summary>
        public string systemId { get; set; }
    }

  
    #endregion
}
